package redis.inaction.spring.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;

import java.io.Serializable;

@RedisHash(value = "repository_demo", timeToLive = 60)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class City implements Serializable {
    public static City CITY_NULL = new City(-1L,"-1L","-1L");

    @Id
    private Long id;
    @Indexed
    private String code;
    private String name;
}
